<template>
    <div>

        <!-- 图文列表 -->
        <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="(item,index) in Newslist" :key="item.comment_ID">
					<router-link :to="'/home/newsinfo/'+index">
						<img class="mui-media-object mui-pull-left" :src="item.pics">
						<div class="mui-media-body">
							<h1>{{item.comment_author}}</h1>
							<p class='mui-ellipsis'>
                                <span>发表时间:{{item.comment_date | dataFormat('YYYY-MM-DD') }}</span>
                                <span>点击{{item.sub_comment_count}}次</span>
                            </p>
						</div>
					</router-link>
				</li>
             
			
			</ul>
    </div>
</template>
<script>
import {Toast} from 'mint-ui'
export default {
  data() {
    return {
        Newslist:[]
    };
  },
  created() {
    this.getNewslist();
  },
  methods: {
    getNewslist() {
      this.$http.get("jandan/pics?page=1").then(result => {
    
        if (result.body.code == 1) {
          this.Newslist = result.body.data.comments;

        } else {
          Toast("获取轮播图数据失败!");
        }
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.mui-media-body {
  h1 {
    font-size: 14px;
  }
  .mui-ellipsis {
    color: #26a2f2;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
  }
}
</style>
